﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;

namespace PYS.Models
{


    public class LogOnModel
    {
        [Required(ErrorMessage="Camp obligatoriu.")]
        [Display(Name = "Email")]
        [DataType(DataType.EmailAddress,ErrorMessage="Introduceti o adresa de e-mail valida!")]
        [RegularExpression(@"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$",ErrorMessage="Adresa de e-mail nu este valida!")]
        public string email { get; set; }

        [Required(ErrorMessage="Camp obligatoriu.")]
        [Display(Name = "CNP")]
        [RegularExpression(@"^[1-2]\d{12}", ErrorMessage = "CNP-ul nu este valid")]
        public string cnp { get; set; }

        [Display(Name = "Tine-ma minte")]
        public bool RememberMe { get; set; }
    }

    public class RegisterModel
    {
        [Required (ErrorMessage="Camp obligatoriu.")]
        [Display(Name = "Nume")]
        public string lastName { get; set; }

        [Required(ErrorMessage = "Camp obligatoriu.")]
        [Display(Name = "Prenume")]
        public string firstName { get; set; }

        [Required(ErrorMessage="Camp obligatoriu.")]
        [DataType(DataType.EmailAddress)]
        [RegularExpression(@"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", ErrorMessage = "Adresa de e-mail nu este valida!")]
        [Display(Name = "Email")]
        public string Email { get; set; }

        [Required(ErrorMessage="Camp obligatoriu.")]
        [RegularExpression(@"^[1-2]\d{12}",ErrorMessage="CNP-ul nu este valid!")]
        [Display(Name = "CNP")]
        public string cnp { get; set; }
    }
}
